<clr-modal [(clrModalOpen)]="openToken" clrModalSize="xl">
  <h3 class="modal-title">Cluster Token</h3>
  <div class="modal-body">
    <textarea rows="20" cols="128" *ngIf="token" [(ngModel)]="token"></textarea>
    <div *ngIf="!token">
      Cluster Token 获取中......<i class="fa fa-spinner fa-pulse"></i>
    </div>
  </div>
  <div class="modal-footer">
    <!--<button type="button" class="btn btn-primary" ngxClipboard [cbContent]="token" (cbOnSuccess)="openToken=false">复制</button>-->
  </div>
</clr-modal>
<app-confirm-alert (confirm)="handleEvent()"></app-confirm-alert>
<app-webkubectl></app-webkubectl>
<app-upgrade (confirm)="handleUpgrade()"></app-upgrade>
<div class="clr-row">
  <div class="clr-col-12">
    <div class="card">
      <div class="card-header">
        描述
      </div>
      <div class="card-block">
        <ul class="list-unstyled">
          <li><b>集群名称:</b>{{currentCluster.name}}</li>
          <li><b>kubernetes 版本: </b>{{currentCluster.package}}</li>
          <li *ngIf="currentCluster.plan"><b>区域: </b>{{currentCluster.region}}</li>
          <li *ngIf="currentCluster.plan"><b>可用区: </b>{{currentCluster.zones}}{{currentCluster.zone}}</li>
          <li><b>部署模式:</b> {{getDeployTypeComment(currentCluster.deploy_type)}}</li>
          <li><b>存储类型: </b>{{currentCluster.persistent_storage}}</li>
          <li *ngFor="let info of clusterInfos"><b>{{info.name}}:</b> {{info.value}}</li>
          <li><b>创建时间:</b> {{currentCluster.date_created | date: 'yyyy-MM-dd HH:mm:ss'}}
          </li>
        </ul>
      </div>
      <div class="card-footer">
        <div class="clr-row">
          <div class="clr-col-9">
            <button class="btn btn-outline" (click)="onInstall()" [disabled]="currentCluster.status === 'RUNNING'">安装
            </button>
            <button class="btn btn-outline" (click)="onUninstall()" [disabled]="currentCluster.status === 'READY'">卸载
            </button>
            <button class="btn btn-outline" (click)="onUpgrade()" [disabled]="currentCluster.status !== 'RUNNING'">升级
            </button>

            <button class="btn btn-outline" (click)="onDownload()" [disabled]="currentCluster.status !== 'RUNNING'">
              下载kube-config
            </button>
            <button class="btn btn-outline" (click)="onGetToken()" [disabled]="currentCluster.status !== 'RUNNING'">
              获取Token
            </button>
            <button class="btn btn-outline" (click)="openWebkubectl()" [disabled]="currentCluster.status !== 'RUNNING'">
              WEBKUBECTL
            </button>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>

